<!DOCTYPE html>
<!--添加弹窗层-->
<html>
    <head>
        <title></title>
        <link rel="stylesheet" type="text/css" href="/Public/Index/css/workflow.css">
        <link href="/Public/Index/css/page.css" rel="stylesheet" />
        <!--<script src="/Public/static/jquery/jquery-2.0.3.min.js"></script>-->
        <script src="/Public/static/jquery/jquery-1.11.3.js"></script>
        <script src="/Public/static/layer/layer.js"></script> 
        <script type="text/javascript" src="/Public/Index/js/common.js" ></script>
        <script type="text/javascript" src="/Public/Index/js/layer.js" ></script>
        <link rel="stylesheet" type="text/css" href="/Public/static/datetimepicker-master/jquery.datetimepicker.css">
        <script type="text/javascript" src="/Public/static/datetimepicker-master/rilegou/jquery.datetimepicker.full.js" ></script>
        <style>
            /*分页*/
            .page .num,.next,.end,.prev,.first{
                display: inline-block;
                margin: 0 2px;
                color:#437dba;
            }
            .page .num,.current,.end{
                border: 1px solid #ddd;
                border-radius: 5px;
                display: inline-block;
                height: 30px;
                line-height: 30px;
                text-align: center;
                width: 30px;
            }
            .page .next,.prev,.first{
                border: 1px solid #5faee3;
                border-radius: 5px;
                color: #5faee3;
                height: 30px;
                width: 30px;
                line-height: 30px;
                text-align: center;
            }

            /*部门分类开始*/
            .bounced {
                background:#fff;
                border:1px solid #ccc;
                width:95%;
                margin:1em auto;
                line-height: 1.45;
                font-size: 0.8em;
                overflow: auto;
                position: relative;
            } 
            .people_left {
                float:left;
                width:33%;
                display: block;	
                border-right:1px solid #ccc;
            }
            .people_right ul,.people_main ul {
                list-style-type:none;
            }
            .people_left ul li {
                border-bottom:1px solid #e8e8e8;
                padding: 1em;
            }
            .people_left ul li a{color:#333;}
            .people_left ul .pe a {
                color:#36c;
            } 
            .people_left ul li a:hover {
                text-decoration:none;
            }
            .people_right {
                float:right;
                width:65%;
                margin:0 auto;
            }
            .people_main{width:100%;margin:0 auto}
            .people_right p,.people_main p{
                text-align:center;
                color:#333;
                margin:0 auto;
                margin-top:0.5em;
                margin-bottom:0.5em;
                width:90%;
            }
            .select_people .dd {
                background: #5fc6c6;;
            }
            .select_people .qk {
                background: #ed8d76;
            }
            sure_submit .cancel  {
                background:#
            }
            .select_people .dd,.select_people .qk {
                border: none;
                text-align: center;
                cursor: pointer;
                padding: 7px 5px;
                width:4em;
                -moz-border-radius: 4px;
                -webkit-border-radius: 4px;
                border-radius: 4px;
                margin-right:1em;
                float:left;
                margin-bottom:1em;
            }
            .select_people .dd a,.select_people .qk a {
                color:#fff;
            }

            .select_peo {
                clear:both;
            }
            .select_peo ul input {
                margin-right:0.3em;
            }
            .select_peo ul li label{
                width:28%;
                display:inline-block;
            }
            .select_peo ul li .c-name {
                display:inline-block;
                width:65%;
                text-align: center;

            }
            .select_peo ul li{
                text-align: center; 
                height:30px; 
                line-height:30px;
            }
            .select_peo ul li .all-line{
                display:inline-block;
                width:90%;
                text-align: left;

            }
            .select_peo ul li .c-img{
                width:16px;
                display:inline-block;
                margin-top:3px;
            }
            .checked{ background:#437dba;color:#fff;}
            .select_peo ul li {

                border-bottom:1px dashed #e8e8e8;
            }
            /*部门分类结束*/
            .sure_submit {
                margin-top:1.5em;
                margin-bottom:2em;
                margin-left:1em;
                font-size:1em;
            }
            .sure_submit a:first-child {
                background: #437dba;
                color: #fff;
            }
            .sure_submit a:last-child {
                background: #ddd;
                color: #333;
            }
            .sure_submit .sure,.sure_submit .back {
                border: none;
                cursor: pointer;
                padding: 4px 15px;
                font-size:0.8em;
                width:4em;
                -moz-border-radius: 4px;
                -webkit-border-radius: 4px;
                border-radius: 4px;
                margin-right:0.8em;
            }

            .people_main .content{
                width:98%;
                height:auto;
                margin: 1em auto;
            }
            .checkMonth {
                line-height:40px;
                border-bottom: 1px solid #f8f8f8;
                height:40px;
                /*padding-left:5%;*/
                font-size: 1.4rem;
                text-align: center;
                list-style: none;
            }
            .people_main .content textarea{padding:8px;border:1px solid #efefef;}
            .select_peo .flow2{list-style: none}
            .select_peo .flow2 li{}
            .select_peo .flow2 li .flowName{font-size: 1.4em;display:inline-block;padding:1em 0}

            .pointer{cursor: pointer}

            .verifyArea{width: 90%;padding:1.5em 1em;margin:0 auto;font-size: 1.4em;background: #fff}
            .verifyArea table{width:100%;border-collapse: collapse;border:1px solid #e8e8e8;}
            .verifyArea table tr td{border:1px solid #e8e8e8;padding:0.3em 0.5em;height:1.5em;line-height: 1.5em}
            .verifyArea .datepickerInput{display:inline-block;margin-right:0.2em;padding: 0.3em;width:95%}
            .verifyArea textarea{width:95%;padding: 0.5em;}
            .verifyArea .valid_textarea{display:none}

            #reason_cont{background: #F4FF77;font-size: 1.4em}
            #reason_cont p{padding: 0.5em;border-bottom: 1px solid #e8e8e8;font-size: 1.6em;width:95%;margin:0 auto}
            #reason_cont div{padding:1em;font-size: 1.4em}
        </style>
    </head>
    <body>
    <if condition="$type eq 1">
        <form id="departForm">
            <div class="bounced">
                <div class="people_left" style="overflow:auto;overflow-y：scroll;height:326px;">
                    <ul>
                        <li class="pointer pe" data-dept="0">
                            <!--<a data-url="{:U('Index/getUserData',array('dept_id'=>'','flow_id'=>$flow_id,'run_id'=>$run_id,'prcs_id'=>$prcs_id,'auto_type'=>$auto_type))}">[符合条件]</a>-->
                            <a data-url="{:U('getAjaxPage',array('dept_id'=>'','flow_id'=>$flow_id,'run_id'=>$run_id,'prcs_id'=>$prcs_id,'auto_type'=>$auto_type))}">[符合条件]</a>

                        </li>
                        <foreach name="departs" item="depart">
                            <li class="pointer" data-dept="{$depart.dept_id}">
                                <!--<a data-url="{:U('Index/getUserData',array('dept_id'=>$depart['dept_id'],'flow_id'=>$flow_id,'run_id'=>$run_id,'prcs_id'=>$prcs_id,'auto_type'=>$auto_type))}">[{$depart.dept_name}]</a>-->
                                <a data-url="{:U('getAjaxPage',array('dept_id'=>$depart['dept_id'],'flow_id'=>$flow_id,'run_id'=>$run_id,'prcs_id'=>$prcs_id,'auto_type'=>$auto_type))}">[{$depart.dept_name}]</a>

                            </li>
                        </foreach>
                    </ul> 
                </div>
                <div class="people_right">
                    <p>全部经办人</p>
                    <div class="select_people">
                        <div class="checkUser dd add-all"><a>全部添加</a></div>
                        <div class="checkUser qk add-del"><a>全部删除</a></div>
                    </div>
                    <div class="select_peo">
                        <ul>
                            <foreach name="users" item="user">
                                <if condition='$user["checked"] && count($users) == 1'>
                                    <li class="pointer" data-id="{$user.user_id}">
                                    <if condition="$flow_id neq null">
                                        <label class="checked"><img src="/Public/Index/img/s1.png" class="c-img">主办</label>
                                    </if>
                                    <span class="c-name checked">{$user.user_name}</span>
                                    </li> 
                                    <elseif condition="$user['checked']"/>
                                    <li class="pointer" data-id="{$user.user_id}">
                                    <if condition="$flow_id neq null">
                                        <label class=""><img src="/Public/Index/img/s2.png" class="c-img">主办</label>
                                    </if>
                                    <span class="c-name checked">{$user.user_name}</span>
                                    </li> 
                                    <else/>
                                    <li class="pointer" data-id="{$user.user_id}">
                                    <if condition="$flow_id neq null">
                                        <label><img src="/Public/Index/img/s2.png" class="c-img">主办</label>
                                    </if>
                                    <span class="c-name">{$user.user_name}</span>
                                    </li>
                                </if>
                            </foreach>
                        </ul>
                        <!--判断是否为流程中的选择人员，$id不存在则为其他模块-->
                        <input type="hidden" name="id" value="{$id|default=0}">
                        <input type="hidden" name="table_key" value="{$table_key|default=0}">
                        <input type="hidden" name="flow_id" value="{$flow_id|default=0}">
                        <input type="hidden" id="url" value="{:U('getAjaxPage')}">
                    </div>
                </div>
            </div>
            <div class="page">{$pages}</div>
            <div class="sure_submit" style="text-align: center">
                <a class="sure pointer submitRole" style="margin-right:10px">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </form>
        <elseif condition="$type eq 2" />
        <div class="bounced select_peo">
            <form id="prcsForm">
                <ul class="flow2">
                    <foreach name="runs" item="run">
                        <li>
                            <input type="radio" name="flow_prcs" value="{$run.prcs_id}"/>
                        <sapn class="flowName" data-url="{:U('backFlow',array('run_id'=>$run['run_id'],'prcs_id'=>$run['prcs_id'],'flow_prcs'=>$run['prcs_id'],'current_prcs_id'=>$currPrcsId,'current_flow_prcs'=>$currFlowPrcs))}">{$run.prcs_name}</span>
                            </li>
                    </foreach>
                </ul>
            </form>
            <div class="sure_submit" style="text-align: center">
                <a class="sure pointer submitBack" style="margin-right:10px">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </div>
        <elseif condition="$type eq 3" />
        <div class="people_main">
            <p style="font-size:1.4em;font-weight: bold">全部部门</p>
            <div class="select_people" style="margin-left:7%;">
                <div class="checkUser dd add-all-dept"><a>全部添加</a></div>
                <div class="checkUser qk add-del-dept"><a>全部删除</a></div>
            </div>
            <div class="select_peo">
                <ul>
                    <foreach name="depts" item="dept">
                        <li class="pointer" data-id="{$dept.dept_id}">
                            <span class="all-line">{$dept.dept_name}</span>
                        </li> 
                    </foreach>
                </ul>
            </div>
            <div class="sure_submit" style="text-align: center">
                <a class="sure pointer submitDept" style="margin-right:10px">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </div>
        <elseif condition="$type eq 4" />
        <form id="diaryForm" method="post" action="{U('Diary/replyDiary')}">
            <div id="reply_content"><textarea style="width:80%;height:10em;border:1px solid #CFDDEA;margin-left: 10%;"></textarea></div>
            <div class="sure_submit" style="text-align: center">
                <a class="sure pointer submitReply" style="margin-right:10px" data-url="{:U('Diary/replyDiary',array('comment_id'=>$comment_id,'dia_id'=>$dia_id))}">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </form>
        <elseif condition="$type eq 5" />
        <div class="people_main">
            <div class="content" style="text-align: center">
                <textarea class="feedback" alt='批注' style="width:95%;height:18em;"></textarea>
            </div>
            <div class="sure_submit" style="text-align: center">
                <input type="hidden" class="plan_id" value="{$id}">
                <input type="hidden" class="is_end" value="{$is_end}">
                <input type="hidden" class="dept" value="{$dept}">
                <input type="hidden" class="cType" value="{$cType}">
                <input type="hidden" class="lng" value="" />
                <input type="hidden" class="lat" value="" />
                <a class="sure pointer submitComment" style="margin-right:10px" data-url="{:U('Plan/comment')}">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </div>
        <elseif condition="$type eq 6" />
        <form>
            <div id="reply_content"><textarea name="content" style="width:80%;height:10em;border:1px solid #CFDDEA;margin: 3% 10%;"></textarea></div>
            <div class="sure_submit" style="text-align: center">
                <input type="hidden" name="comment_id" value="{$id}">
                <a class="sure pointer submitReplyWeekly" style="margin-right:10px" data-url="{:U('Diary/replyWeekly')}">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </form>
        <elseif condition="$type eq 7" />
        <div class="people_main">
            <p style="font-size:1.4em;font-weight: bold">选择角色</p>
            <div class="select_people" style="margin-left:5em">
                <div class="checkUser dd add-all-priv"><a>全部添加</a></div>
                <div class="checkUser qk add-del-dept"><a>全部删除</a></div>
            </div>
            <div class="select_peo">
                <ul>
                    <foreach name="privs" item="priv">
                        <li class="pointer" data-id="{$priv.user_priv}">
                            <span class="all-line-priv">{$priv.priv_name}</span>
                        </li> 
                    </foreach>
                </ul>
            </div>
            <div class="sure_submit" style="text-align: center">
                <a class="sure pointer submitRole" style="margin-right:10px">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </div>
        <elseif condition="$type eq 8" />
        <form>
            <div class="verifyArea">
                <table>
                    <tr>
                        <td width="30%">标题：</td>
                        <td>{$notify.subject}</td>
                    </tr>
                    <tr>
                        <td width="30%">发布人：</td>
                        <td><font color="blue"><b>部门：</b></font>{$notify.from_id|getChineseName}</td>
                    </tr>
                    <tr>
                        <td width="30%">发布范围：</td>
                        <td>{$notify.to_id|getMoreDeptname}</td>
                    </tr>
                    <tr>
                        <td width="30%">发布时间：</td>
                        <td><input class="datepickerInput" data-type="1" type="text" name="SEND_TIME" value="{$notify.send_time}"></td>
                    </tr>
                    <tr>
                        <td width="30%">生效日期：</td>
                        <td><input class="datepickerInput" type="text" data-type="0" name="BEGIN_DATE" value="{$notify.begin_date|date='Y-m-d',###}"></td>
                    </tr>
                    <tr>
                        <td width="30%">终止日期：</td>
                        <td><input class="datepickerInput" type="text" data-type="0" name="END_DATE" value="{$notify.end_date|date='Y-m-d',###}"></td>
                    </tr>
                    <tr>
                        <td width="30%">置顶：</td>
                        <td>
                            <input type="checkbox" name="TOP" style='width:16px;' vlaue='{$notify.top}' {$notify['top'] ? 'checked' :''}>设置为置顶 
                            <input type="text" name="TOP_DAYS" style="width:30px" value='{$notify.top_days}'>天后结束置顶
                        </td>
                    </tr>
                    <tr>
                        <td width="30%">是否批准：</td>
                        <td>
                            <input type="radio" name="PUBLISH" value="1" class="pass">通过
                            <input type="radio" name="PUBLISH" value="3" class="pass" style="margin-left:3em;">不通过
                        </td>
                    </tr>
                    <tr class="valid_textarea">
                        <td width="30%">意见：</td>
                        <td><textarea name="REASON"></textarea></td>
                    </tr>
                </table>
            </div>
            <div class="sure_submit" style="text-align: center">
                <input type="hidden" name="notify_id" value="{$notify.notify_id}">
                <a class="sure pointer submitNotifyVerify" style="margin-right:10px" data-url="{:U('Notice/verifyNotice')}">确定</a>
                <a class="sure pointer cancel" >取消</a>
            </div>
        </form>
        <elseif condition="$type eq 9" />
        <div id="reason_cont">
            <p>{$notify.auditer|getChineseName} 对此公告通知的意见：</p>
            <div>{$notify.reason}</div>
        </div>
        <elseif condition="$type eq 10" />
        <ul class="">
            <foreach name="months" item="month" key="key">
                <li class="checkMonth pointer" data-month="{$key}">{$month}</li>
            </foreach>
        </ul>
        <input type="hidden" id="monthUrl" value="{:U('Plan/historyList')}">
    </if>
</div>

<script src="https://api.map.baidu.com/api?v=2.0&ak=ZoVYMpI2FZWKafTn6GIjojqinVFGHMbI&s=1" type="text/javascript"></script>  
<script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script> 
<script type="text/javascript" src="/Public/static/dropload/dropload.js" ></script>
<script  type="text/javascript">
    $(initLayer())
    $(dateTime(0));
    $(function () {
        $('#testTime').datetimepicker({
            format: "Y-m-d", ////格式化日期
            lang: 'ch', //设置语言
            timepicker: false, //关闭时间选项
        });

        var geolocation = new BMap.Geolocation();
        geolocation.getCurrentPosition(function (r) {
            if (this.getStatus() == BMAP_STATUS_SUCCESS) {
                var mk = new BMap.Marker(r.point);
                lat = r.point.lat; //纬度
                lng = r.point.lng;   //经度
                $('body').find('.lng').val(lng);
                $('body').find('.lat').val(lat);
            }
        })



//        p = 2;
//        var dropload = $('.bounced').find('.select_peo ul').dropload({
//            scrollArea: window,
//            domDown: {
//                domClass: 'dropload-down',
//                domRefresh: '<div class="dropload-refresh">上拉加载更多</div>',
//                domLoad: '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//                domNoData: '<div class="dropload-noData">已无数据</div>'
//            },
//            loadDownFn: function (me) {
//                if($('.people_left ul li').attr('class') == 'pointer pe'){
//                    var dept_id = $('.pe').attr('data-dept');
//                }else{
//                    var dept_id = 0;
//                }
//                var url = $('#url').val() + '?p=' + p;
//                var flow_id = $('input[name="flow_id"]').val();
//                p++;
//                $.ajax({
//                    url: url,
//                    type: 'get',
//                    success: function (res) {
//                        console.log(res);
//                        if (res.length > 0) {
//                            var html = '';
//                            for (var i = 0; i < res.length; i++) {
//                                html += '<li class="pointer" data-id='+res[i].user_id+'>';
//                                if(flow_id != 0){
//                                    html += '<label><img src="/Public/Index/img/s2.png" class="c-img">主办</label>';
//                                }
//                                html += '<span class="c-name">'+res[i].user_name+'</span>';
//                            }
//                            $('.select_peo ul li:last').after(html);
//                        } else {
//                            me.noData();
//                        }
//                        me.resetload();
//                    }
//                })
//            }
//        });

    })
</script>
</body>
</html>
